//
//  UIColor+Extension.swift
//  传智新浪微博
//
//  Created by app on 17/6/2.
//  Copyright © 2017年 app. All rights reserved.
//

import UIKit

extension UIColor {
    
    class func colorWithHex(hexColor: Int64, alpha: CGFloat)-> UIColor {
        
        let red = ((CGFloat)((hexColor & 0xFF0000) >> 16))/255.0;
        let green = ((CGFloat)((hexColor & 0xFF00) >> 8))/255.0;
        let blue = ((CGFloat)(hexColor & 0xFF))/255.0;
        
        return UIColor(red: red, green: green, blue: blue, alpha: alpha)
    }
    
    
    class func arcRandomColor() -> UIColor {
        
        let red = CGFloat(arc4random_uniform(255))/CGFloat(255.0)
        let green = CGFloat( arc4random_uniform(255))/CGFloat(255.0)
        let blue = CGFloat(arc4random_uniform(255))/CGFloat(255.0)
        let alpha = CGFloat(arc4random_uniform(255))/CGFloat(255.0)
        
        return UIColor.init(red: red, green: green, blue: blue, alpha: alpha)
    }
}
